'use strict';

import React, {Component} from 'react';
import {
  Navigator
} from 'react-native';
import HomePage from './HomePage';

export default class MyNavigator extends React.Component {
  static defaultProps = {
    defaultName: 'HomePage',
    defaultComponent: HomePage,
  };

  render() {
    return (
      <Navigator
        initialRoute={{ name: this.props.defaultName, component: this.props.defaultComponent }}
        configureScene={(route) => {
                return Navigator.SceneConfigs.FadeAndroid;
              }}
        renderScene={(route, navigator) => {
                let Component = route.component;
                return <Component {...route.params} navigator={navigator} />
              }} />
    );
  }
}
